package com.chen.controller;

import com.chen.model.ConfigBean;
import com.chen.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/11/27.
 */
@RestController
@EnableConfigurationProperties({ConfigBean.class})
public class LucyController {

    @Autowired
    ConfigBean configBean;

    @RequestMapping(value = "/lucy")
    public String miya(){
        return configBean.getGreeting() + " >>>> " + configBean.getName() + " >>>> " +
                configBean.getUuid() + " >>>> " + configBean.getNumber();
    }

    @Autowired
    private User user;

    @RequestMapping(value = "/user")
    public String user(){
        return user.getName() + user.getAge();
    }

}
